<template>
  <div class="to-do-item">
    <p class="item-text">
      <input type="checkbox" class="item-checkbox" :checked="todo.state" @click="complete">
      {{todo.text}}
    </p>
  </div>
</template>

<script>
export default {
  props: {
    todo: Object
  },
  methods: {
    complete () {
      this.$emit('complete')
    }
  }
}
</script>

<style>
.to-do-item {
  border: 1px solid #eaeaea;
}
.item-text {
  padding: 10px;
  font-size: 25px;
}
.item-checkbox {
  display: inline-block;
  height: 20px;
  width: 20px;
  margin: 0 !important;
}
</style>
